// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Cloud Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 53 : TYPE_CLOUD

// Function declarations
reserve function Cloud_DebugDraw
reserve function Cloud_DebugSpawn

// Static Values

// Tables

function Cloud_DebugDraw
	DrawSprite(0)
end function


function Cloud_DebugSpawn
	CreateTempObject(TypeName[Cloud], 0, object.xpos, object.ypos)
end function


event ObjectMain
	object.xpos += object.xvel
	if object.value1 == 0
		object.drawOrder = 2
		switch object.propertyValue
			case 0
				object.xvel = -0xC000
				break
			case 1
				object.xvel = -0x8000
				break
			case 2
				object.xvel = -0x4000
				break
		end switch
		object.value1 = 1
	end if
end event


event ObjectDraw
	DrawSprite(0)
end event


event ObjectStartup
	LoadSpriteSheet("MBZ/Objects.gif")
	SpriteFrame(-31, -13, 62, 26, 2, 393)
	SetTableValue(TypeName[Cloud], DebugMode_ObjCount, DebugMode_TypesTable)
	SetTableValue(Cloud_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
	SetTableValue(Cloud_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
	DebugMode_ObjCount++
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
